// component/dialog/dialog.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    content:"",
    shown:false,
    opa:0
  },

  /**
   * 组件的方法列表
   */
  methods: {
    showDialog(obj){
      var that = this;
      this.setData({
        shown:true,
        content: obj.msg,
        opa: 1
      });
      setTimeout(function(){
        that.setData({
          opa:0
        });
        setTimeout(function(){
          that.setData({
            shown:false
          });
        },600)
      }, obj.duration || 1500)
      
    },
    hideDialog(){
      this.setData({
        shown: false,
        opa: 1
      })
    }
  }
})
